package org.demo.szml.loggingservice.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.demo.szml.eventtype.event.BaseEvent;
import org.demo.szml.eventtype.event.logging.LoggingEvent;
import org.demo.szml.eventtype.router.logging.LoggingEventRouter;
import org.springframework.stereotype.Component;

/**
 * @description: 日志操作死信队列消费者
 * @date: 2025/6/20 11:14
 * @version: 1.0
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = LoggingEventRouter.LOGGING_DEAD_EVENT_TOPIC, consumerGroup = LoggingEventRouter.LOGGING_DEAD_EVENT_GROUP)
public class LoggingDeadMessageConsumer implements RocketMQListener<BaseEvent.EventMessage<LoggingEvent.LoggingEventInfo>> {


    @Override
    public void onMessage(BaseEvent.EventMessage<LoggingEvent.LoggingEventInfo> loggingEventInfoEventMessage) {
        log.error("对于日志信息为:{},消费失败!",loggingEventInfoEventMessage.getData());
    }
}
